home *** CD-ROM | disk | FTP | other *** search
- Short: AllocP - BetterAlloc (AllocMem/AllocVec patch) V1.0
- Author: Andreas_Kleinert@t-online.de
- Uploader: Andreas_Kleinert@t-online.de
- Type: util/sys
-
- Sometimes programs fail with a "not enough memory" error,
- but after calling "avail flush" the same operation does
- succeed without problems.
-
- Obviously AllocMem/AllocVec does not force such a "flush"
- operation *and* tries to allocate memory again. Why ?
-
- This patch does ensure, that AllocMem/AllocVec won't
- fail unless there's really no memory available, even
- by flushing. This means:
-
- - less "out of memory" failures
- - less "bad behaviour" of bad programs, which don't
- check results of AllocMem/AllocVec
- - no more need to call "avail flush" by hand
- from the shell
- - thus no more "retry" operations after "avail flush"
- - no more unused libraries/devices consuming memory
- when it is already low
-
- Additionally, it makes AllocVec aligning its allocations to
- longword boundaries - at the *end* . As you know, the Alloc#?
- functions always return memory starting at longword-aligned
- boundaries. But since Exec just keeps a list of the free
- memory and not the allocated memory, this could mean, that
- the number of 1, 2 or 3 byte chunks (which would never be
- used again unless their predecessors or successors are
- delocated again) could increase drastically. There's no
- way to bypass this for AllocMem, but for AllocVec the
- requested allocation now automatically will include these
- "gaps", with the following side effects:
-
- - less entries in the free memory list
- - less memory fragmentation
- - less administration overhead
- - a little bit more safety with programs, which
- usually overwrite AllocVec'ed buffers by 1, 2 or
- 3 bytes and otherwise might have produced
- MungWall hits ;-)
- - the latter may also be true for some cases where
- programs don't align their Read/WritePixeLine8()
- buffers ;-)
-
-
- You use this patch at your own risk.
- No guarantee for anything.
- Source code included.
-
- ---
- All mentioned trademarks are subjects to their owners.
-
-
- ============================= Archive contents =============================
-
- Original Packed Ratio Date Time Name
- -------- ------- ----- --------- -------- -------------
- 4084 2496 38.8% 01-Aug-97 10:07:56 +AllocP
- 5828 1371 76.4% 01-Aug-97 10:07:48 +AllocP.c
- 835 390 53.2% 01-Aug-97 10:07:56 +AllocP.info
- 1356 813 40.0% 01-Aug-97 10:07:54 +AllocP.o
- 245 180 26.5% 18-Feb-97 15:15:46 +SCOPTIONS
- 162 100 38.2% 01-Aug-97 09:51:40 +smakefile
- 2094 1042 50.2% 01-Aug-97 10:28:44 +AllocP.readme
- -------- ------- ----- --------- --------
- 14604 6392 56.2% 08-Aug-97 19:45:28 7 files
-